/**
 * Copyright 2004 - 2007 Blue Bamboo International Inc. 
 *           All rights reserved.
 *
 *
 * Blue Bamboo PROPRIETARY/CONFIDENTIAL.
 *
 */

package com.bambamboo.socket.server;

/**
 * DOCME
 * 
 * @author Nick.Tan
 * 
 */
public class ServerConfigurationBean {

	private String port;
	private String handler;
	private String scriptLocation;
	private boolean enable = true;
	private String implementor;

	/**
	 * @param port
	 * @param handler
	 * @param scriptLocation
	 */
	public ServerConfigurationBean(String port, String handler, String scriptLocation) {
		super();
		this.port = port;
		this.handler = handler;
		this.scriptLocation = scriptLocation;
	}

	/**
	 * 
	 */
	public ServerConfigurationBean() {
		super();
	}

	/**
	 * @return the port
	 */
	public String getPort() {
		return port;
	}

	/**
	 * @param port the port to set
	 */
	public void setPort(String port) {
		this.port = port;
	}

	/**
	 * @return the handler
	 */
	public String getHandler() {
		return handler;
	}

	/**
	 * @param handler the handler to set
	 */
	public void setHandler(String handler) {
		this.handler = handler;
	}

	/**
	 * @return the scriptLocation
	 */
	public String getScriptLocation() {
		return scriptLocation;
	}

	/**
	 * @param scriptLocation the scriptLocation to set
	 */
	public void setScriptLocation(String scriptLocation) {
		this.scriptLocation = scriptLocation;
	}

	/**
	 * @return the enable
	 */
	public boolean isEnable() {
		return enable;
	}

	/**
	 * @param enable the enable to set
	 */
	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public String getImplementor() {
		return implementor;
	}

	public void setImplementor(String implementor) {
		this.implementor = implementor;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((handler == null) ? 0 : handler.hashCode());
		result = prime * result + ((port == null) ? 0 : port.hashCode());
		result = prime * result + ((scriptLocation == null) ? 0 : scriptLocation.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ServerConfigurationBean other = (ServerConfigurationBean) obj;
		if (handler == null) {
			if (other.handler != null)
				return false;
		}
		else if (!handler.equals(other.handler))
			return false;
		if (port == null) {
			if (other.port != null)
				return false;
		}
		else if (!port.equals(other.port))
			return false;
		if (scriptLocation == null) {
			if (other.scriptLocation != null)
				return false;
		}
		else if (!scriptLocation.equals(other.scriptLocation))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ServerConfigurationBean [handler=" + handler + ", port=" + port + ", scriptLocation=" + scriptLocation
				+ "]";
	}

}
